package com.bjpowerrnode.functionalInterface.SupplierFunction;

import java.util.function.Supplier;

public class Test {
    public static void main(String[] args) {
        /*使用lambda表达式  实现函数式接口*/
        Integer test = test(() -> {
            int a = 10;
            a = a + 10;
            return a;
        });
        System.out.println(test);

        /*使用双冒号 实现函数式接口*/
        Integer test1 = test(Test::test1);
        System.out.println(test1);

    }
    public static Integer test(Supplier<Integer> supplier){
        Integer integer = supplier.get();
        return integer;
    }
    public static  Integer test1(){
        return 1;
    }
}
